package io.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

import org.junit.Test;

/**
 * 转换流：将字节流转换成字符流
 * @author Administrator
 *
 */
public class TransferDemo {

	/**
	 * 演示字节输入流转换成字符输入流:输入
	 * @throws FileNotFoundException 
	 */
	@Test
	public void dmeo() throws FileNotFoundException {
		InputStreamReader in = new InputStreamReader(new FileInputStream(""));
//		InputStreamReader in = new InputStreamReader(in, Charset.forName("UTF-8")); // in:字节输入流	cs:编码格式
//		InputStreamReader in = new InputStreamReader(in, charsetName); // in:字节输入流	charsetName:编码格式
		
	}
	
	/**
	 * 字节输出流转换成字符输出流：输出
	 * @throws FileNotFoundException 
	 */
	@Test
	public void demo2() throws FileNotFoundException {
		
		OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(""));
//		OutputStreamWriter out = new OutputStreamWriter(out, charset);
//		OutputStreamWriter out = new OutputStreamWriter(out, charsetName);
		
	}
	
	
	
	
	
	
	
	
}
